void main() {
  Person p = Person();

  p.name = "坤坤";
  p.height = 180;

  p.eat();
  p.walk();
  p.study();
}

// 定义基类：动物
class Animal {
  String? name;

  void eat() {
    print('eat');
  }
}

// 使用 with 关键字使用 mixin
class Person extends Animal with WalkMixin, StudyMixin {}

class Cat extends Animal with WalkMixin {}

class Fish extends Animal {
  void swim() {
    print('swim');
  }
}

// 定义 mixin
mixin WalkMixin {
  double? height;
  void walk() {
    print('walk');
  }
}

// minin 可以有多个
mixin StudyMixin {
  void study() {
    print('study');
  }
}
